Change compat-check in set_vcpucontext again. Give caller leeway for
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 1 Mar 2007 10:01:51 +0000 (10:01 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 1 Mar 2007 10:01:51 +0000 (10:01 +0000)
HVM guests only.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/domain.c

index a1e09502702e0f1e00a1b0ad11c66215f90e3935..7c75b49101c83bd9985290403fd318cdf88e4780 100644 (file)
@@ -501,9 +501,12 @@ int arch_set_info_guest(
     unsigned long flags;
     int i, rc = 0, compat;
 
-    /* The context is a compat-mode one if the target domain is compat-mode;
-     * we expect the tools to DTRT even in compat-mode callers. */
-    compat = IS_COMPAT(d);
+    /*
+     * HVM domain builder always builds caller-bitsize vcpu context.
+     * The PV builder is smarter and builds the appropriate type of context for
+     * the target domain. So the compat check here differs in the two cases.
+     */
+    compat = is_hvm_domain(d) ? IS_COMPAT(current->domain) : IS_COMPAT(d);
 
 #ifdef CONFIG_COMPAT
 #define c(fld) (compat ? (c.cmp->fld) : (c.nat->fld))